//
//  TGUserModel.h
//  TongGuanLease
//
//  Created by 张奇 on 2022/5/6.
//

#import "TGBaseModel.h"
#import "TGAuthoritiesModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface TGUserModel : TGBaseModel

@property (nonatomic, strong) NSDictionary *accessToken;
@property (nonatomic, strong) NSDictionary *refreshToken;
@property (nonatomic, copy) NSString *getToken;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *phoneNumber;
@property (nonatomic, copy) NSString *userId;
@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *deptId;
@property (nonatomic, copy) NSString *deptName;
@property(nonatomic,assign)BOOL administrator;//写死的值
@property(nonatomic,assign)BOOL manager;//是不是经理
@property(nonatomic,assign)BOOL serviceSupport;//是不是服务支持人员(索赔使用)
@property (nonatomic , strong) NSArray *authorities; /**用户权限 返回的一维数组*/

@property (nonatomic, assign) NSInteger getAliasSeq;//极光推送别名序列号


@property (nonatomic , strong) TGAuthoritiesModel *authoritiesModel;

+ (TGUserModel *)getUserEntity;
+ (void)save;

+ (void)save:(TGUserModel *)user;
+ (void)update:(TGUserModel*)user;
+ (void)remove;

+ (void)refreshTokenWithComplemention:(ComplentValueBlock)complemention;

// admin
-(BOOL)isAdmin;
// 总领导
-(BOOL)isTopLeader;
// 宣传部人员
-(BOOL)isPublicityWorker;
// 实地调查组
-(BOOL)isInvestigationTeam;
// 区领导
-(BOOL)isRegionLeader;
// 局委领导
-(BOOL)isOrgLeader;
// 局委工作人员
-(BOOL)isOrgWorker;


@end

NS_ASSUME_NONNULL_END
